/*
 *    Copyright (c) 2018-2025, proj All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the proj developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: proj
 */

package com.ykht.proj.coupon.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ykht.proj.common.core.util.R;
import com.ykht.proj.coupon.entity.FxBrandMoneyFlow;
import com.ykht.proj.coupon.entity.FxMerchantAccount;
import com.ykht.proj.coupon.vo.FxMerchantAccountBrandVo;
import com.ykht.proj.coupon.vo.FxMerchantAccountVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * b端账户表
 *
 * @author proj code generator
 * @date 2021-08-12 14:10:39
 */
public interface FxMerchantAccountService extends IService<FxMerchantAccount> {

	/**
	 * B端账号金额加减
	 * @param type				1公司2品牌3门店
	 * @param tatId				关联id
	 * @param balance			可用余额
	 * @param balanceTotal		总余额=可用+冻结
	 * @param balanceFrozen		冻结金额
	 * @param withdrawal		自己提现金额
	 * @param consumeMoney		累计消费金额
	 * @param chargeTotal		累计充值金额
	 * @param updateUser    修改人
	 */
    void updateMerchantAccount(Integer type, Long tatId, BigDecimal balance, BigDecimal balanceTotal,
							   BigDecimal balanceFrozen, BigDecimal withdrawal, BigDecimal consumeMoney,
							   BigDecimal chargeTotal, Long updateUser);

	/**
	 * 分页查询 b端账户表
	 * @param page 分页对象
	 * @param fxMerchantAccountVo b端账户表
	 * @return
	 */
    IPage<FxMerchantAccountVo> getFxMerchantAccountPage(Page page, FxMerchantAccountVo fxMerchantAccountVo);

	/**
	 * 通过id查询b端账户表详情
	 * @param fxMerchantAccountVo b端账户表
	 * @return R
	 */
	FxMerchantAccountVo getByIdAccountDetails(FxMerchantAccountVo fxMerchantAccountVo);


	FxMerchantAccount cheeckOrCreateAccont(Integer type,Long tatId);


	List<FxMerchantAccountVo> getExport();
}
